<template>
  <div class="team">
    <div>
      <a-table :columns="columns" :data-source="data" @change="onChange">
        <div class="td_name" slot="name" slot-scope="text" @click="team_info">{{ text }}</div>
         <div class="td_name" slot="leader" slot-scope="text" @click="peopleDetail">{{ text }}</div>
      </a-table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      columns: [
        {
          title: "班组名称",
          dataIndex: "name",
          key: "name",
          scopedSlots: { customRender: "name" },
          align:"center"
        },
        {
          title: "班组长",
          dataIndex: "leader",
          align:"center",
          key: "leader",
          scopedSlots: { customRender: "leader" },
          align:"center"
        },
        {
          title: "联系电话",
          dataIndex: "tell",
          align:"center"
        },
      ],
      data: [
        {
          key: "1",
          name: "路基施工一队",
          leader: "李志新",
          tell: "19166120325",
        },
        {
          key: "2",
          name: "路基施工二队",
          leader: "王存义",
          tell: "16609822487",
        },
      ],
    };
  },
  methods: {
    onChange(pagination, filters, sorter) {
      console.log("params", pagination, filters, sorter);
    },
    team_info(){
        this.$router.push({path:'/teamGroup'})
    },
     peopleDetail(){
      this.$router.push({path:'/personnelInformation'})
    }
  },
};
</script>

<style scoped>
::v-deep .ant-table-pagination.ant-pagination {
  display: none;
}
.td_name{
    color: #1890ff;
    cursor: pointer;
}
</style>
